<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="../css/common.css">
  <script src="../js/jquery.js"></script>
  <style>
    .hua{
      width: 100px;
      height: 30px;
      background: #fff;
      text-align: center;
      line-height: 30px;
      font-size: 15px;
      border: 1px solid #ccc;
      box-sizing: border-box;
      position: relative;
      margin: 100px auto;
      /* overflow: hidden; */
    }
    .hua p{
      width: 100px;
      height: 30px;
      position: absolute;
      left: -100px;
      top: -1px;
      box-sizing: border-box;
      background: pink;
      color: #fff;
    }
  </style>
</head>
<body>
    <div class="hua">滑动<p class='pos'>滑动</p></div>    
    <script>
      $(()=>{
        // 划过变色
        $('.hua').hover(()=>{
            console.log(1)
            $('.pos').stop().animate({'left':'0'},500)
        },()=>{
            $('.pos').stop().animate({'left':'100px'},500).animate({'left':'-100px'},0)
        })
      })
    </script>
</body>
</html>